From: kaf24@firebug.cl.cam.ac.uk Date: Tue, 16 May 2006 18:50:23 +0000 (+0100) Subject: Fix MOVS instruction emulation for HVM MMIO. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16047^2~59 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=8b08b9d6025a3e153d1108fc967c4c8af11533d7;p=xen.git Fix MOVS instruction emulation for HVM MMIO. From: Gerd Hoffman Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/hvm/platform.c b/xen/arch/x86/hvm/platform.c index 1e78470d34..1206ebda96 100644 --- a/xen/arch/x86/hvm/platform.c +++ b/xen/arch/x86/hvm/platform.c @@ -865,7 +865,7 @@ void handle_mmio(unsigned long va, unsigned long gpa) * copy ourself. After this copy succeeds, "rep movs" is executed * again. */ - if ((addr & PAGE_MASK) != ((addr + size - 1) & PAGE_MASK)) { + if ((addr & PAGE_MASK) != ((addr + sign * (size - 1)) & PAGE_MASK)) { unsigned long value = 0; mmio_opp->flags |= OVERLAP; @@ -876,7 +876,7 @@ void handle_mmio(unsigned long va, unsigned long gpa) hvm_copy(&value, addr, size, HVM_COPY_IN); send_mmio_req(IOREQ_TYPE_COPY, gpa, 1, size, value, dir, 0); } else { - if ((addr & PAGE_MASK) != ((addr + count * size - 1) & PAGE_MASK)) { + if ((addr & PAGE_MASK) != ((addr + sign * (count * size - 1)) & PAGE_MASK)) { regs->eip -= inst_len; /* do not advance %eip */ if (sign > 0)